package com.ganbo.ms.socket;


import org.junit.Test;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class SocketDemo {


    @Test
    public void ipAddressTest() throws UnknownHostException {
        InetAddress byAddress = InetAddress.getByName("www.baidu.com");
        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println(byAddress);
        System.out.println(localHost);
    }
}
